﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StockFinder.Model;
using StockFinder.Model.Enumerations;

namespace StockFinder.Services.Extractors
{
    ///// <summary>
    ///// Provides a stubbed test implementation for price extractor
    ///// </summary>
    //public class TestHistoricPricesExtractor : IHistoricPricesExtractor
    //{
    //    private static Random _Random = new Random();

    //    /// <summary>
    //    /// Returns a random series of prices
    //    /// </summary>
    //    /// <param name="fromDate"></param>
    //    /// <param name="toDate"></param>
    //    /// <param name="symbol"></param>
    //    /// <returns></returns>
    //    public HistoricPricesExtract GetHistoricPrices(DateTime fromDate, DateTime toDate, string symbol)
    //    {
    //        HistoricPricesExtract result = new HistoricPricesExtract();
    //        result.HistoricPricesExtractResult = HistoricPricesExtractResult.SUCCESS;
    //        //symbol.Prices = new List<DailyPrice>();

    //        //int random = _Random.Next(3000);

    //        //DateTime priceDate = DateTime.Today;

    //        //for (int day = 0; day < random; day++)
    //        //{
    //        //    priceDate = DateTime.Today.AddDays(day);

    //        //    symbol.Prices.Add(new DailyPrice()
    //        //    {
    //        //        PriceDate = priceDate,
    //        //        AdjustedClose = 10,
    //        //        Close = 10,
    //        //        High = 10,
    //        //        Low = 10,
    //        //        SymbolId = symbol.SymbolId,
    //        //        Volume = 100000
    //        //    });
    //        //}

    //        return result;
    //    }

    //    public Model.HistoricPricesExtract GetHistoricPrices(string symbol)
    //    {
    //        HistoricPricesExtract result = new HistoricPricesExtract();
    //        symbol.Prices = new List<DailyPrice>();
    //        result.HistoricPricesExtractResult = HistoricPricesExtractResult.SUCCESS;

    //        int random = _Random.Next(3000);

    //        DateTime priceDate = DateTime.Today;

    //        for (int day = 0; day < random; day++)
    //        {
    //            priceDate = DateTime.Today.AddDays(day * -1);

    //            symbol.Prices.Add(new DailyPrice()
    //            {
    //                PriceDate = priceDate,
    //                AdjustedClose = 10,
    //                Close = 10,
    //                High = 10,
    //                Low = 10,
    //                SymbolId = symbol.SymbolId,
    //                Volume = 100000
    //            });
    //        }

    //        return result;
    //    }

    //    public bool LoadHistoricPrices(DateTime fromDate, DateTime toDate, Symbol symbol)
    //    {
    //        throw new NotImplementedException();
    //    }

    //    public bool LoadHistoricPrices(DateTime fromDate, DateTime toDate, string symbolName, List<DailyPrice> dailyPricesTransporter)
    //    {
    //        throw new NotImplementedException();
    //    }
    //}
}
